/***
Customized Bootstrap Dropdowns
***/

/***
Dropdowns
***/

.dropup.open,
.dropdown.open {
    > .dropdown-toggle {
        border-color: #ddd;
    } 
}

/***
Dropdown Menu
***/

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    display: none;
    float: left;
    list-style: none;
    text-shadow: none;
    padding: 0px;
    margin:0px;
    background-color: #ffffff; 
    box-shadow: 5px 5px rgba(#666, 0.1);
    border: 1px solid #efefef;
    font-size: 14px;
    font-family: $font-family-default;
    
    li > a {
        padding: 6px 0 6px 13px;
        color: #333;
        text-decoration: none;
        display: block;
        clear: both;
        font-weight: normal;
        line-height: 18px;
        white-space: nowrap;
    }

    li > a:hover, 
    .active > a, 
    .active > a:hover {
      text-decoration: none;
      background-image: none;
      background-color: #eee;
      color: #333;
      filter:none;
    }

    &.bottom-up {
        top: auto;
        bottom: 100%;
        margin-bottom: 2px;
    }
}


/* Dropdown submenu support for Bootsrap 3 */
.dropdown-submenu {
    position: relative;

    > .dropdown-menu {
        top: 5px;
        left: 100%;
        margin-top: -6px;
        margin-left: -1px;
    }
    
    > a:after {
      position: absolute;
      display: inline-block;
      font-size: 14px;
      right: 7px;
      top: 7px;
      font-family: FontAwesome;
      height: auto;
      content: "\f105";
      font-weight: 300;
    }

    &:hover > .dropdown-menu {
        display: block;
    }

    &:hover > a:after {
        border-left-color: #ffffff;
    }

    &.pull-left {
        float: none;
        
        > .dropdown-menu{
            left: -100%;
            margin-left: 10px;
        }
    }

    // dropdown menu in dropup mode
    .dropup & > .dropdown-menu {
        top: auto;
        bottom: 0;
        margin-top: 0;
        margin-bottom: -2px;
    }
}


.nav.pull-right > li > .dropdown-menu,
.nav > li > .dropdown-menu.pull-right {
    right: 0;
    left: auto;

    &:before {
        right: 12px;
        left: auto;   
    }

    &:after {
        right: 13px;
        left: auto;   
    }

    .dropdown-menu {
        right: 100%;
        left: auto;
        margin-right: -1px;
        margin-left: 0;
    }

}

@media (max-width: $screen-xs-max) { /* 767px */

    .navbar-nav {
        .open {
            .dropdown-menu {
                position: absolute;
                float: left;
                width: auto;
                margin-top: 0;
                background-color: #ffffff;
                border: 1px solid #efefef;
                box-shadow: 5px 5px rgba(#666, 0.1); 

                > li {
                    > a {
                        padding: 6px 0 6px 13px;
                        color: #333;
                    }

                    > a:hover,
                    > a:active {
                        ackground-color: #eee;
                    }
                }
            }
        }
    }
}

/***
Dropdown Checkboxes
***/

.dropdown-content {
    padding:5px;

    form {
        margin:0;
    }
}

.dropdown.inline .dropdown-menu {
    display: inline-block;  
    position: relative;
}

.dropdown-radiobuttons,
.dropdown-checkboxes {
    padding: 5px;

    label {
        display: block;
        font-weight: 300;
        color: #333;
        margin-bottom: 4px;
        margin-top: 4px; 

        .radio {
            margin-right: 3px;
        }
    }
}
